#include "misc.h"

int toInt(unsigned char hit, unsigned char lot) {
  int t=0;
  t=(hit<<8)+lot;
  return t;
}



unsigned char hi(int i) {
  return i >> 8;
}

unsigned char lo(int i) {
  return (char)i;
}



int limiti(int value, int max, int min) {
	if (value>max) 
		value=max;
	if (value<-min) 
		value=-min;
}

double limitd(int value, int max, int min) {
	if (value>max) 
		value=max;
	if (value<-min) 
		value=-min;

}
